#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <queue>

using namespace std;

class KthLargest {
public:
    priority_queue<int, vector<int>, greater<int>> _heap;
    int _k;

    KthLargest(int k, vector<int>& nums) {
        _k = k;
        for (auto& e : nums)
        {
            _heap.push(e);
            if (_heap.size() > _k)
                _heap.pop();
        }
    }

    int add(int val) {
        _heap.push(val);
        if (_heap.size() > _k)
            _heap.pop();

        return _heap.top();
    }
};

int main()
{

	return 0;
}